import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "index",
    component: () => import("@/views/test/dIndex.vue"),
  },
  {
    path: "/test",
    name: "test",
    component: () => import("@/views/test/index.vue"),
  },
  {
    path: "/dIndex",
    name: "dIndex",
    component: () => import("@/views/home/index.vue"),
  },
  {
    path: "/from",
    name: "from",
    component: () => import("@/views/test/from.vue"),
  },

  {
    path: "/pindex",
    name: "pindex",
    redirect: "/phome",
    component: () => import("@/views/test/paginationMixin/index.vue"),
    children: [
      {
        path: "/phome",
        name: "phome",

        component: () => import("@/views/test/paginationMixin/home.vue"),
      },
      {
        path: "/pabout",
        name: "pabout",
        component: () => import("@/views/test/paginationMixin/about.vue"),
      },
    ],
  },
  {
    path: "/filters",
    name: "filters",
    component: () => import("@/views/test/filters/index.vue"),
  },
  {
    path: "/API",
    name: "API",
    component: () => import("@/views/test/API/index.vue"),
  },
  {
    path: "/transition",
    name: "transition",
    component: () => import("@/views/test/transition/index.vue"),
  },
  {
    path: "/upload",
    name: "upload",
    component: () => import("@/views/test/upload/index.vue"),
  },
  {
    path: "/avatarCropper",
    name: "avatarCropper",
    component: () => import("@/views/test/avatarCropper/index.vue"),
  },
  {
    path: "/download",
    name: "download",
    component: () => import("@/views/test/download/index.vue"),
  },
  {
    path: "/dongtai/:id",
    name: "dongtai",
    component: () => import("@/views/test/dongtai/index.vue"),
  },
  {
    path: "/webSocket",
    name: "webSocket",
    component: () => import("@/views/test/webSocket.vue"),
  },

  {
    path: "/chatRoom",
    name: "chatRoom",
    component: () => import("@/views/test/chatRoomDemo/index.vue"),
  },
];

const router = new VueRouter({
  routes,
});

export default router;
